package com.example.tliasmanagement.config;

import com.example.tliasmanagement.dto.AddressDTO;
import com.example.tliasmanagement.dto.UserDTO;
import org.dom4j.io.SAXReader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

// 说明这个类是一个java配置类
@Configuration
public class AppConfig {

    @Bean
    public SAXReader saxReader(){
        return new SAXReader();
    }
    @Bean
    public AddressDTO addressDTO(){
        return new AddressDTO("home", "work");
    }

    @Bean
    public UserDTO userDTO(AddressDTO addressDTO){
        //return  new UserDTO("user", addressDTO());
        return new UserDTO("user", addressDTO);
    }
}